Skip to content

[front] feat: wire Members/Groups tabs of the usage filter panel to real, period-scoped data - #30168

Merged
avervaet merged 13 commits into
mainfrom
avervaet/wiring-usage-filter-component-members-tab
Aug 10, 2026
Merged

[front] feat: wire Members/Groups tabs of the usage filter panel to real, period-scoped data#30168
avervaet merged 13 commits into
mainfrom
avervaet/wiring-usage-filter-component-members-tab

Conversation

@avervaet

@avervaet avervaet commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

This PR wires the Members and Groups tabs of the usage page's filter panel to real, period-scoped data, and connects the resulting UsageFilter state into the underlying consumption queries.

Until now:

  • The Members tab was populated from the full workspace member roster, with no awareness of the selected time period. Every workspace member appeared regardless of whether they had any activity in the window.
  • The Groups tab was entirely mocked.
  • The UsageFilter selection for the "member" dimension had no effect on the overview, chart, or attribution table queries.

This PR:

  • Members now come from the same period-ranked consumption data that drives the Attribution table. Only members with activity in the selected period window are surfaced, ranked by consumption.
  • Groups are no longer mocked. A new relevant-groups endpoint resolves, for that same set of period-active users, which groups they belonged to during the period window. This keeps the group list contextually relevant rather than listing all workspace groups unconditionally.
  • The UsageFilter state (member dimension) is now forwarded to the overview, chart, and attribution table consumption queries, so filtering by member actually narrows the displayed data.

A new route was added under front-api/routes/ — OpenAPI docs should be regenerated (npm -w front-api run docs) and published via the Deploy OpenAPI Docs GitHub action.

Tests

Testing evidence was not provided for this draft.

Risk

Low. The changes are additive on the data-fetching side: the existing member roster fallback is replaced by a scoped query, and the new relevant-groups endpoint is a net-new read-only route. The UsageFilter wiring only affects query parameters; no data model changes or migrations are involved. Safe to rollback by reverting the front deployment.

Deploy Plan

  • Deploy front.

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
playground Ignored Ignored Preview Aug 10, 2026 3:53pm
storybook Ignored Ignored Preview Aug 10, 2026 3:53pm

Request Review

@dust-agent dust-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding Rules LGTM \o/

Comment thread front/components/workspace/analytics/usageFilter.ts
@avervaet
avervaet force-pushed the avervaet/usage-filter-consumption-scope-wiring branch from 422d611 to ae2261f Compare August 10, 2026 07:21
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-members-tab branch from e3b3e3a to b78e388 Compare August 10, 2026 07:21
@avervaet
avervaet force-pushed the avervaet/usage-filter-consumption-scope-wiring branch from ae2261f to 9246936 Compare August 10, 2026 08:35
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-members-tab branch from b78e388 to 3df4875 Compare August 10, 2026 08:35
@avervaet
avervaet force-pushed the avervaet/usage-filter-consumption-scope-wiring branch from 9246936 to a30cb37 Compare August 10, 2026 09:04
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-members-tab branch from 3df4875 to 29acbab Compare August 10, 2026 09:04
@avervaet
avervaet force-pushed the avervaet/usage-filter-consumption-scope-wiring branch from a30cb37 to c833b23 Compare August 10, 2026 09:29
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-members-tab branch 2 times, most recently from 1ce2dfc to 5ac24fc Compare August 10, 2026 09:53
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-members-tab branch from 5ac24fc to 516e948 Compare August 10, 2026 10:00
@avervaet
avervaet force-pushed the avervaet/usage-filter-consumption-scope-wiring branch from 6f888c0 to 7a11ac9 Compare August 10, 2026 12:08
@avervaet
avervaet changed the base branch from avervaet/usage-filter-consumption-scope-wiring to avervaet/fix-pluralize-consumption-scope-filter-names August 10, 2026 12:09
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-members-tab branch from 516e948 to 7ee187b Compare August 10, 2026 12:09
@avervaet
avervaet force-pushed the avervaet/fix-pluralize-consumption-scope-filter-names branch from a43056f to d282602 Compare August 10, 2026 12:22
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-members-tab branch from 7ee187b to 878cd0e Compare August 10, 2026 12:22
Base automatically changed from avervaet/fix-pluralize-consumption-scope-filter-names to main August 10, 2026 13:01
…eal, period-scoped data

Members now come from the same period-ranked consumption data the
Attribution table uses (useConsumptionTop) instead of the full,
period-unaware member roster. Groups are no longer mock: a new
relevant-groups endpoint resolves, for that same set of period-active
users, which groups they belonged to during the period window (not
"now"), via a new GroupResource.listGroupsForUserModelIdsInWindow.
Matches the naming convention already used by the consumption scope
dimensions and consumptionDimensions.ts: the category key is "user"
(same as the ES dimension it filters on), "Members" stays the display
label. Avoids a per-category translation layer as more categories get
wired to real data.
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor
Warnings
⚠️

Files in front-api/routes/ have been modified and the PR has the documentation-ack label.
Don't forget to run npm -w front-api run docs and use the Deploy OpenAPI Docs Github action to update https://docs.dust.tt/reference.

Generated by 🚫 dangerJS against 96fb4f4

@avervaet avervaet added the documentation-ack Used to acknowledge that documentation is up-to-date with this PR label Aug 10, 2026
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-members-tab branch from 1834153 to 2003783 Compare August 10, 2026 13:13
selectedIds: Set<string>;
onToggleOption: (option: UsageFilterOption) => void;
onSelectAll: () => void;
// Only set for categories backed by a paginated server fetch (members).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed when all the filtering are properly wired

@aubin-tchoi aubin-tchoi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but let's start thinking about simplifying

Comment thread front/components/workspace/analytics/UsageFilterPanel.tsx Outdated
Comment thread front/lib/resources/group_resource.ts Outdated
Comment thread front-api/routes/w/[wId]/groups/index.ts Outdated
Comment thread front/components/workspace/analytics/UsageFilterPanel.tsx Outdated
onFilterChange: (next: UsageFilter) => void;
}

export function UsageFilterPanel({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React Doctor · react-doctor/no-giant-component (warning)

Component "UsageFilterPanel" is over 300 lines long, which is hard to read & change. Split it into a few smaller components.

Fix → Pull each section into its own component so the parent is easier to read, test, and change.

Docs

@avervaet
avervaet merged commit ce7a68d into main Aug 10, 2026
42 checks passed
@avervaet
avervaet deleted the avervaet/wiring-usage-filter-component-members-tab branch August 10, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation-ack Used to acknowledge that documentation is up-to-date with this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants